<?php

/*
  Processo para comunicar recibos de transaccoes recebidas

 */

# Defaults
$PID = 170;

#Capta data de Ultima execucao atraves de trn_methods
if ($GETCOMMETH[1]['tcmtLastRun'] == '') {
    $Process_LastTaskTime = $GETCOMMETH[1]['tcmtFirstRun'];
} else {
    $Process_LastTaskTime = $GETCOMMETH[1]['tcmtLastRun'];
}
if ($Process_LastTaskTime == '') {
    $error = 'Metodo invalido.';
}
if (!isset($error)) {


    $CorrCode = $GETCOMMETH[1]['CorrAgente'];
    $CorrExt = $GetMethodParams[1]['EXT'];
    $CorrFName = $GetMethodParams[1]['ffFilenameFormat'];
    $CorrOb = $GetMethodParams[1]['OB'];
    $CorrVers = $GetMethodParams[1]['VERSION'];
    $CorrDlm = $GetMethodParams[1]['DELIMITER'];
    $TrnTime = $sysTime;

    $TransactionModel = $TFTPATH_MODELS . $CorrDlm . '_' . $CorrExt . '_' . $CorrOb . '_' . $CorrVers . '_' . $PID . '.php';

    if ($this->tft_OutputSingleFile($TransactionModel, $DatadirTransmitionOut, $this->sql_GetTransactionRows($PID, $CorrespID, $Process_LastTaskTime), null,$GETCOMMETH,$GetSettings,$TrnTime,$CorrCode,$CorrFName,$CorrExt) == true) {
        $TransmissionResultCode = 2;
    }
}